# Author : wyq
import json
info ={
    'name':'alex',
    'age':22
}
# 写入
# f = open("test.text","w")
# f.write(str(info))
#
# f.close()
# 读出
# f = open("test.text","r")
# data =eval(f.read())
# f.close()
# print(data['age'])

# json 序列化
# f = open("test.text","w")
# f.write(json.dumps(info))
# f.close()

# json 反序列化
f = open("test.text","r")
data = json.loads(f.read())
print(data["age"])
